The index of the first needle inside s, or -1 if it is not there - finding text inside a string.
string_find(s, needle) -> int| Name | Type |
|---|---|
s | string |
needle | string |
int
The index of the first needle inside s, or -1 if it is not there - finding text inside a string.
string_find(s, needle) == 0 is "does s start with needle"; combine with string_slice for "does it end with needle" (compare the last string_length(needle) characters).
var message = "you found a key!";
var found_key = string_find(message, "key") != -1;`string_find(s, needle) == 0` is "does s start with needle"; combine with string_slice for "does it end with needle" (compare the last string_length(needle) characters).